Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes for Jsonnet global inventory and inventory dumping #1191

Merged
merged 2 commits into from
Jul 15, 2024
Merged

Fixes for Jsonnet global inventory and inventory dumping #1191

merged 2 commits into from
Jul 15, 2024

Conversation

Emberwalker
Copy link
Contributor

This is a couple of fixes for an issue we encountered when testing the current version on master against our inventories, which use inventory_global. This also adds a missing arg for the kapitan inventory command that I encountered while debugging the global inventory issue. I've also included a few changes to the types to make things a little clearer for other contributors and Pylance/IDE type checking.

black seems to have made quite a few formatting changes during pre-commit, which I'm happy to back out if we don't want those!

Proposed Changes

  • Add --yaml-dump-null-as-empty flag to kapitan inventory (required by the YAML dumper)
  • Ensure the global inventory is returned to Jsonnet as a Python dict instead of a Pydantic type

Docs and Tests

  • Tests added
  • Updated documentation

Without this, the YAML pretty printer was looking up an entry
that didn't exist in the args cache during 'kapitan inventory'.
Normalise the type returned from the inventory native helper
to avoid a Jsonnet failure, as the Pydantic types weren't
able to be used by it. Also touch up some type handling to
hopefully help avoid a repeat of this issue.
@ademariag ademariag self-requested a review July 15, 2024 12:44
@ademariag ademariag enabled auto-merge July 15, 2024 12:45
@ademariag ademariag merged commit 06f653b into kapicorp:master Jul 15, 2024
8 checks passed
@Emberwalker Emberwalker deleted the small-fixes branch July 15, 2024 13:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants